#define THIS_FILE "detruire.sqf"
#include <base\tmf_constants.h>
#include <base\tmf_macros.h>
WAITINIT(detruire);
// _this call Destroy;

// ["Land_Communication_F","marker1"] execVM "detruire.sqf";
if (!isServer) exitWith {};
private ["_type","_marker","_destroyed","_error"];
DEFAULT_PARAM(_type,0,"");
DEFAULT_PARAM(_marker,1,"");
DEFAULT_PARAM(_destroyed,2,"");
DEFAULT_PARAM(_destroyed_msg,3,ARR_1("STR_TYR_TARGET_DESTROYED"));

_error = false;
if (typename _type == typename "") then { _error = (_type == "") };
if (typename _marker == typename "") then { _error = (_marker == "") };
if (_error) exitWith {};

_obj_params = [];
_obj_params set [TMF_VEH_PARAMS_TYPE, _type];
_obj_params set [TMF_VEH_PARAMS_POS, _marker];

_tmf_params = [];
_tmf_params = [_tmf_params,"DESTROY_MSG",_destroyed_msg] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"SHARED_VAR",_destroyed] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"SHARED_VAR_VAL",true] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"AMMO_COUNT",2] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"AMMO_TYPES",["SatchelCharge_Remote_Mag","DemoCharge_Remote_Mag"]] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"DESTROYED_CODE",""] call CFUNC(hashSet);

//OBJ1 = [["Land_Communication_F","marker1"],"DESTROY",["Olaf's Money","You found the money","jip_money_found","Take the money",True]] call FFUNC(CreateMissionObject);
OBJ = [_obj_params,"DESTROY",_tmf_params] call FFUNC(CreateMissionObject);
